﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;

namespace BO.DemoKeThua
{
    public class DongVatChung
    {

        public string demo1="";
        public static string demo2 = "";

        string demophat = "";
        public class DemoPublic { }
        public static class DemoNotPublic { }
        //day la thang cha
        public class XayDungDongVat
        {
            private int number = 0;
            protected string name = "";
            public static int SetNumber(int iNumber)
            {
                return iNumber;
            }
            public int SetNumberNoStatic(int iNumber)
            {
                number = iNumber;
                return number;
            }
            //public static void SetName(string sName)
            //{
            //    name = sName;
            //}
            protected string GetAnimal()
            {
                string kq = "Con " + name + " co' " + number + " chan";
                return kq;
            }

        }
        //thang con se ke thua    
        public class XayDungConMeo : XayDungDongVat
        {
            //public string kq = "";
            //public XayDungConMeo():base()
            //{
            //    base.SetNumber(4);
            //    base.SetName("con meo");
            //    //kq = base.GetAnimal();
            //}

            //XayDungDongVat xd = new XayDungDongVat();
            //public string GetConMeo() : base (
            //{

            //    XayDungDongVat xl = new XayDungDongVat();
            //    xl
            //    string kq = "";
            //    return kq;
            //}
            public XayDungConMeo()
                : base()
            {
                base.name = "meo meo";
            }
            public int SetNumberNoStatic(int iNumber) //overrwrite
            {
                return iNumber + 3;
            }
        }
        //collection
        class Student
        {
            public string name;
            public int age;
        }
        public class DemoCollection
        {
            List<Student> lt = new List<Student>();
            
            public void AddStudent(string name,int age)
            {
                Student st = new Student();
                st.name = name;
                st.age = age;
                lt.Add(st);
            }
        }
    }
}
